<template>
	<view class="examresult">
		<view class="resultBox">
			<view class="resultBox_top">
				<image src="../../static/image/iconfool.png" style="width: 48rpx;height: 48rpx;" mode="">
				</image>
				<view class="" style="margin-left: 20rpx;">
					考试类型：{{pageData[0].type == 8?'Others':pageData[0].type_text}}
				</view>
			</view>

			<view class="resultBox_content">

				<view class="content_item" v-for="(item,index) in pageData ">
					<view class="content_top">
						<view class="">
							{{item.created_at}}
						</view>
						<view class="">
							<!-- {{item.discipline_time}} -->
						</view>
					</view>

					<!-- TOEFL IELTS  PTE -->
					<view v-if="item.type==1 || item.type==2 || item.type==3" class="contentmessage">
						<view class="contentmessageitem">
							<view class="lable">
								Listening
							</view>
							<view class="value">
								{{item.achievements}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Speaking
							</view>
							<view class="value">
								{{item.achievement2}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Reading
							</view>
							<view class="value">
								{{item.achievement1}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Writing
							</view>
							<view class="value">
								{{item.achievement3}}
							</view>
						</view>

					</view>

					<!-- SAT -->
					<view v-if="item.type==4" class="contentmessage">
						<view class="contentmessageitem">
							<view class="lable">
								Reading
							</view>
							<view class="value">
								{{item.sta_achievements}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Maths
							</view>
							<view class="value">
								{{item.sta_achievement2}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Writing & Language
							</view>
							<view class="value">
								{{item.sta_achievement1}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.sta_achievement3}}
							</view>
						</view>

					</view>
					<!-- ACT -->
					<view v-if="item.type==5" class="contentmessage">
						<view class="contentmessageitem">
							<view class="lable">
								English
							</view>
							<view class="value">
								{{item.act_achievements}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Reading

							</view>
							<view class="value">
								{{item.act_achievement2}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Maths
							</view>
							<view class="value">
								{{item.act_achievement1}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Science
							</view>
							<view class="value">
								{{item.act_achievement3}}
							</view>
						</view>
					</view>

					<!-- GRE -->
					<view v-if="item.type==6" class="contentmessage">
						<view class="contentmessageitem">
							<view class="lable">
								Verbal
							</view>
							<view class="value">
								{{item.gre_achievements}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Writing

							</view>
							<view class="value">
								{{item.gre_achievement2}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Antitive
							</view>
							<view class="value">
								{{item.gre_achievement1}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.gre_achievement3}}
							</view>
						</view>
					</view>

					<!-- GMAT -->
					<view v-if="item.type==7" class="contentmessage">
						<view class="contentmessageitem">
							<view class="lable">
								ntegrated Reasoning

							</view>
							<view class="value">
								{{item.gmat_achievements}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Verbal

							</view>
							<view class="value">
								{{item.gmat_achievement2}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Antitive

							</view>
							<view class="value">
								{{item.gmat_achievement1}}
							</view>
						</view>
						<view class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.gmat_achievement3}}
							</view>
						</view>
					</view>


					<view v-if="item.type==8" class="contentmessage">
						<view v-if="item.other_achievements" style="width: 33.33%;" class="contentmessageitem">
							<view class="lable">
								科目
							</view>
							<view class="value">
								{{item.other_type}}
							</view>
						</view>
						
						<view v-if="item.other_achievements" style="width: 33.33%;" class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.other_achievements}}
							</view>
						</view>
						<view v-if="item.other_achievement2" style="width: 33.33%;" class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.other_achievement2}}
							</view>
						</view>
						<view v-if="item.other_achievement1" style="width: 33.33%;" class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.other_achievement1}}
							</view>
						</view>
						<view v-if="item.other_achievement3" style="width: 33.33%;" class="contentmessageitem">
							<view class="lable">
								Notes
							</view>
							<view class="value">
								{{item.other_achievement3}}
							</view>
						</view>
						<view v-if="item.other_achievement_zong" style="width: 33.33%;" class="contentmessageitem">
							<view class="lable">
								Total
							</view>
							<view class="value">
								{{item.other_achievement_zong}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>


		<view class="remark_imgBox">
			<view v-if="pageData[0].remark" class="remark">
				{{pageData[0].remark}}
			</view>

			<view v-if="pageData[0].remark" class="heng"></view>

			<view class="" style="display: flex;flex-wrap: wrap;margin-top: 20rpx;">
				<view class="" v-for="(item,index) in pageData[0].remark_image">
					<image class="imgitem" :src="item" mode="" @click="handleimgbig(pageData[0].remark_image)"></image>
				</view>
			</view>

		</view>


		<view class="" style="height: 100rpx;"></view>

	</view>
</template>

<script>
	import {
		academicDetails
	} from "@/api/api.js"
	export default {
		data() {
			return {
				pageId: "",
				pageData: {},
			}
		},
		onLoad(options) {
			this.pageId = options.id
			this.handleacademicDetails()

		},
		methods: {
			async handleacademicDetails() {
				let res = await academicDetails({
					id: this.pageId,
					type: "2"
				})
				this.pageData = res.data
				// this.pageData.achievements = JSON.parse(this.pageData.achievements)
				if (this.pageData[0].remark_image) {
					this.pageData[0].remark_image = this.pageData[0].remark_image.split(",")
				}

				console.log("pageData", this.pageData[0].remark_image)
			},
			handleimgbig(imgarr) {
				uni.previewImage({
					current: 0, // 当前显示图片的链接（必填）
					urls: imgarr, // 要预览的图片链接列表（必填）
					success() {
						// console.log('预览图片成功');
					},
					fail(err) {
						// console.log('预览图片失败', err);
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.examresult {
		padding: 30rpx;
		box-sizing: border-box;

		.resultBox {
			.resultBox_top {
				width: 690rpx;
				height: 92rpx;
				background: linear-gradient(180deg, #E1E8FD 0%, #FEFEFF 100%);
				border-radius: 16rpx 16rpx 0rpx 0rpx;
				padding: 22rpx 20rpx;
				box-sizing: border-box;
				display: flex;
				align-items: center;
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				color: #255A9B;
				line-height: 32rpx;
			}

			.resultBox_content {
				padding: 30rpx 20rpx;
				background-color: #ffffff;
				border-radius: 0rpx 0rpx 16rpx 16rpx;

				.content_item {
					border-bottom: 1rpx solid #F6F6F6;
				}

				.content_item:last-child {
					border-bottom: none;
				}

				.content_top {
					margin-top: 30rpx;
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #232832;
					line-height: 36rpx;
					display: flex;
					align-items: center;
					font-size: 32rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					color: #255A9B;
					line-height: 32rpx;
					justify-content: space-between;
				}
			}

			.contentmessage {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				margin-top: 20rpx;

				.contentmessageitem {
					width: 50%;
					display: flex;
					justify-content: space-between;
					flex-direction: column;
					align-items: center;

					.lable {
						// width: 200rpx;
						font-size: 28rpx;
						height: 56rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #232832;
						line-height: 56rpx;
					}

					.value {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #9E9E9E;
						line-height: 56rpx;
					}

				}
			}

		}

	}

	.remark_imgBox {
		width: 690rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 30rpx;
		box-sizing: border-box;
		background: #FFFFFF;
		margin-top: 30rpx;

		.remark {
			width: 100%;
			word-wrap: break-word;
		}

		.heng {
			width: 650rpx;
			height: 1rpx;
			background-color: #F4F4F7;
			margin-top: 20rpx;
		}

		.imgitem {
			width: 140rpx;
			height: 140rpx;
			border-radius: 10rpx 10rpx 10rpx 10rpx;
			opacity: 1;
			margin-right: 20rpx;
		}

		.imgitem:nth-child(4n) {
			margin-right: 0;
		}
	}
</style>